<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <title>充值</title>
    <meta name="generator" content="editplus"/>
    <meta name="author" content="充值中心"/>
    <link rel="shortcut icon" type="image/png" href="/static/favicon.ico"/>
    <link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
    {% include 'link.html'%}
    <script src="/static/lib/csrf.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            var g_ExRate = 6.6
            var type = document.getElementsByName('type');
            var amount = document.getElementsByName('amount');
            var price = document.getElementById('price');
            var money = document.getElementById('money');
            var FormSubmit = document.getElementById('Submit');
            for (var i = 0; i < type.length; i++) {
            type[i].onclick = function () {
            switch (parseInt(this.value)) {
            case 1:
            FormSubmit.value = '支付宝支付';
            break;
            case 2:
            FormSubmit.value = 'QQ钱包支付';
            break;
            case 3:
            FormSubmit.value = '微信支付';
            break;
            default:
            FormSubmit.value = '支付宝支付';
            }
            }
            }
            for (var i = 0; i < amount.length; i++) {
                amount[i].onclick = function () {
                    price.value = parseInt(this.value)
                        get_amount.value = (this.value / g_ExRate).toFixed(2)
                }
            }
            $("#price").change(function(){
                get_amount.value = (price.value / g_ExRate).toFixed(2)
                });
        })
function checksubmit(obj) {
    var user = $("#pay_id").val();
    var money = $("#price").val();
    var email = $("#email").val();

    //if (!user || user.length < 1) {
    //    alert('帐号不能为空');
    //    return false;
    if (!money || money < 0.10) {
        alert('金额必须大于0.10');
        return false;
    }
    if (!email || email == "" ) {
        alert('注册邮件或手机必须填写');
        return false;
    }
    $('#form1').submit()
}

$(".w-pay-money").click(function () {
        $(".w-pay-money").removeClass('w-pay-money-selected');
        $(this).addClass('w-pay-money-selected');
        price.value = $(this).attr('data');
        money.value = $(this).attr('data');
        });
    </script>

    <style>
        .red {
            color:#ff007a!important; //粉红色
        }

        .button {
            color: #666;
            background-color: #EEE;
            border-color: #EEE;
            font-weight: 300;
            font-size: 16px;
            font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
            text-decoration: none;
            text-align: center;
            line-height: 40px;
            height: 40px;
            padding: 0 40px;
            margin: 0;
            display: inline-block;
            appearance: none;
            cursor: pointer;
            border: none;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-transition-property: all;
            transition-property: all;
            -webkit-transition-duration: .3s;
            transition-duration: .3s;
        }

        .button-primary {
            background-color: #1B9AF7;
            border-color: #1B9AF7;
            color: #FFF;
        }

        .button-primary:visited:visited {
            color: #FFF;
        }

        .button-primary:hover, .button-primary:focus
        {
            background-color: #4cb0f9;
            border-color: #4cb0f9;
            color: #FFF;
        }

        .button-pill {
            border-radius: 200px;
        }

        .alipay_select {
            width: 120px;
            background: url(/static/images/pay/alipay.jpg) no-repeat 14px 0;
        }

        .wechat_select {
            width: 140px;
            background: url(/static/images/pay/weixinpay.jpg) no-repeat 16px 0;

        }

        .type_select {
            float: left;
            padding: 1px;
            margin: 5px 5px 0px 0px;

            border: 1px solid #80C5FF;
            color: #0061F3;
            font-size: 13px;
            padding: 5px;
            margin-left: 0px;
            float: left;
            padding-left: 2px;
            padding-right: 20px;
            padding-top: 14px;
            height: 40px;
        }
    </style>
</head>

<body>
{% include "header.html" %}
<div id="main">
    <div id="content">
        <div class="col-sm-12">
            <form name="form1" id="form1" method="post" action="{%url 'deposit_legal_create_order_by_mail'%}" target="_blank">
                {% csrf_token %}
                <label for="lastname" class="col-sm-offset-4 col-sm-8 control-label">在线充值</label>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-9 red">
                        <input type="radio" name="amount" value="100"><i class="fa fa-cny"></i>100</input>
                        <input type="radio" name="amount" value="200"><i class="fa fa-cny"></i>200</input>
                        <input type="radio" name="amount" value="500"><i class="fa fa-cny"></i>500</input>
                        <input type="radio" name="amount" value="1000"><i class="fa fa-cny"></i>1000</input>
                        <input type="radio" name="amount" value="2000"><i class="fa fa-cny"></i>2000</input>
                        <input type="radio" name="amount" value="5000"><i class="fa fa-cny"></i>5000</input>
                        <input type="radio" name="amount" value="10000"><i class="fa fa-cny"></i>10000</input>
                        <input type="radio" name="amount" value="20000"><i class="fa fa-cny"></i>20000</input>
                        <input type="radio" name="amount" value="50000"><i class="fa fa-cny"></i>50000</input>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-6 col-xs-10">
                        <div class="input-group">
                            <span class="input-group-addon green">充值金额</span>
                            <input type="text" class="form-control" name="price" id="price" placeholder="充值金额">
                            <span class="input-group-addon green">{{'cny'|upper}}</span>
                        </div>
                    </div>
                </div>
                <!--
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-6 col-xs-10">
                        <div class="input-group">
                            <span class="input-group-addon green">得到金额</span>
                            <input type="text" class="form-control" name="get_amount" id="get_amount" placeholder="得到金额">
                            <span class="input-group-addon green">{{'usd'|upper}}</span>
                        </div>
                    </div>
                </div>
                -->
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-6 col-xs-10">
                        <div class="input-group">
                            <span class="input-group-addon">充值邮件/手机号</span>
                            <input type="text" class="form-control red" name="email" id="email" placeholder="注册邮件或者注册手机" value='{{phone}}'>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-8">
                        <div class="input-group">
                            <label>
                                <div class="type_select alipay_select">
                                    <input type="radio" name="type" value="1" checked="checked">
                                </div>
                            </label>

                            <label>
                                <div class="type_select wechat_select">
                                    <input type="radio" name="type" value="3">
                                </div>
                            </label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-6">
                        <div class="input-group">
                            <input type="button" onclick="checksubmit()" id="Submit" class="button button-pill button-primary" value="支付宝支付">
                        </div>
                    </div>
                </div>
                <div class="col-sm-offset-2 col-sm-6">
                    <h6><span id="custom" class="green"> 1.提示:支付时，请务必输入<b class='red'>二维码提示金额</b>,否则不能及时到账</span></h6>
                    <h6><span id="custom" class="green"> 2.充值的时候可以先充值少量金额看看是否到账</span></h6>
                </div>

                <input type="hidden" name="act" value="0">
                <input type="hidden" name="id" value="13399">
                <input type="hidden" name="debug" value="0">
                <input type="hidden" name="pay_type" value="1">
                <input type="hidden" name="return_url" value="https://bincoinnow.com/{%url 'deposit_legal_return' %}">
            </form>
        </div>
    </div>
    {%include 'sidebar.html'%}
    {%include 'foot.html'%}
</div>
</body>
</html>
